Scripting More Than Six Vehicles - Tutorial

By Cmaster


You can't have more than six vehicles if you edit them in globals. Here is how to script spawn vehicles.
  1. In sapien, add your seventh vehicle and place its spawn point on the map where you want it.

  2. Once you have placed the vehicle, under the properties palette type a name for the vehicle. Suppose you call it "rockethog1".



    You do not need to add that vehicle in globals, that will only create problems.

  3. Now, open notepad. Type this:

    (script startup vehiclespawn
    (object_create_anew rockethog1)
    )

    You do not need to name the script vehiclespawn, you can name it whatever you choose.

  4. You must name every vehicle you want to script spawn a different name in sapien and spawn them all with the script. For example, a finished script should look something like this:

    (script startup vehiclespawn
    (object_create_anew warthog1)
    (object_create_anew warthog2)
    (object_create_anew rockethog1)
    (object_create_anew rockethog2)
    (object_create_anew jet1)
    (object_create_anew jet2)
    (object_create_anew pwnmobile1)
    )


  5. Once you have typed your script in notepad save it under data\levels\test\yourmapname\scripts (you must make a scripts folder in your map data folder) as scripts.hsc. Make sure the file is not saved as scripts.hsc.txt. When saving the file, choose "all types" under "save as type" to ensure that it is saved correctly.

  6. Then in sapien, go to file -> compile scripts. Sapien should say "scripts sucessfuly compiled". Then save your scenario and compile your map, open halo and enjoy! Hope this helps!